import type { DynamicProps } from '/#/utils';
import type { BasicTableProps, BasicColumn } from '/@/components/Table/src/types/table';
import { getBrandListByPage } from '/@/api/sys/brand/brand';
import { FormProps } from '/@/components/Table';
import { FormSchema } from '/@/components/Form';
type Props = Partial<DynamicProps<BasicTableProps>>;
// 列配置
const tableColumns: BasicColumn[] = [
  {
    title: '属性名称',
    dataIndex: 'name',
    fixed: 'left',
    width: 200,
  }
];

const searchSchemas: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '列属性名称',
    componentProps: {
      placeholder: '列属性名称',
    },
    colProps: {
      span: 14,
    },
  }
]

export const formConfig: Partial<FormProps> = {
  labelWidth: 90,
  schemas: searchSchemas,
  actionColOptions: {
    span: 8,
    style: { textAlign: 'left', marginLeft: '10px' },
  },
};

export const tableConfig: Props = {
  api: getBrandListByPage,
  columns: tableColumns,
  useSearchForm: true,
  formConfig: formConfig,
  showIndexColumn: true,
  rowKey: 'id',
  bordered: true
};


